| Conditions | 5 |
| Paths | 5 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 2 | ||
| Bugs | 0 | Features | 0 |
| 1 | var deptData = null; |
||
| 13 | function getDepartmentDone(jqXHR) |
||
| 14 | { |
||
| 15 | if(jqXHR.status !== 200 || jqXHR.responseJSON === undefined) |
||
| 16 | { |
||
| 17 | alert('Unable to obtain department!'); |
||
| 18 | return; |
||
| 19 | } |
||
| 20 | var data = jqXHR.responseJSON; |
||
| 21 | deptData = data[0]; |
||
| 22 | $('#departmentNameRO').append(deptData.departmentName); |
||
| 23 | $('#departmentName').val(deptData.departmentName); |
||
| 24 | if(deptData.description !== undefined) |
||
| 25 | { |
||
| 26 | $('#description').val(deptData.description); |
||
| 27 | } |
||
| 28 | if(deptData.public) |
||
| 29 | { |
||
| 30 | $('#public').prop('checked', true); |
||
| 31 | $('#privateDept').hide(); |
||
| 32 | } |
||
| 33 | $.ajax({ |
||
| 34 | url: 'api/v1/departments/'+deptData.departmentID+'/roles', |
||
| 35 | type: 'GET', |
||
| 36 | dataType: 'json', |
||
| 37 | complete: getRoleDone}); |
||
| 38 | } |
||
| 39 | |||
| 80 |